/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Mark
 */
package gfs;

import java.awt.Color;
import java.util.ArrayList;

public class StrategoLake extends Object
    {
    /**
     * Lake objects cannot be created use method lakeCoors instead.
     */
    public StrategoLake()
        {
        throw new InstantiationError("Cannot Make your own objects of " +
                "StrategoLake.  Please use StategoLake.getLake() to get" +
                " the lake objects");
        }
    
    private StrategoLake(Coordinate cd, StrategoGraphicLib lib) 
        {
        super();
        this.cd = cd;
        this.lib = lib;
        }
    
    /**
     * Returns an <code>ArrayList</code> of <code>StrategoLake</code>s that need 
     * to be placed on the <code>Board</code>.
     * @param bd
     *      The <code>Board</code> on to which you want to use the <code>StrategoLake</code>s
     *      on.
     * @return
     *      The <code>ArrayList</code> of <code>StrategoLake</code>s.
     */
    public static ArrayList<StrategoLake> lakeCoors(Board bd)
        {
        ArrayList<StrategoLake> lakes = new ArrayList<StrategoLake>(LAKE_SIZE);
        lakes.add(new StrategoLake(bd.getCoordinate(4, 1), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(4, 2), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(5, 2), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(5, 1), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(4, 7), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(4, 8), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(5, 7), bd.getLib()));
        lakes.add(new StrategoLake(bd.getCoordinate(5, 8), bd.getLib()));
        return lakes;
        }
    /**
     * Draws this <code>StrategoLake</code>
     */
    public void draw()
        {
        Color formerCol = lib.getPenColor();
        int penW = lib.getPenWidth();
        // saves the past settings
        lib.setPenColor(Color.BLUE);
        lib.setPenWidth(Coordinate.MAX_PEN_WIDTH);
        // inputs the settings to draw the circle
        lib.fillRectangle(cd.getX() - Coordinate.DEFAULT_RADIUS,
                cd.getY() - Coordinate.DEFAULT_RADIUS
                , cd.getX() + Coordinate.DEFAULT_RADIUS,
                cd.getY() + Coordinate.DEFAULT_RADIUS);
        //draws the Stratego piece
        lib.setPenColor(formerCol);
        lib.setPenWidth(penW);
        // turns the colors back to what they were before
        }
    
    /**
     * Returns the <code>Coordinate</code> of this <code>StrategoLake</code>
     * 
     * @return
     *      The <code>Coordinate</code> of this <code>StrategoLake</code>
     */     
    public Coordinate getCoordinate()
        {
        return cd;
        }
    
    private StrategoGraphicLib lib;
    private Coordinate cd;
    public static final int LAKE_SIZE = 8;
    }
